<?php


class Wxapp extends AdminBase{

	public function index(){

		if($this->post()){
			$post=$this->input->post();
			$res=$this->db->update('wxapp',$post);
			if ($res){
				$this->show(['code'=>1,'msg'=>'更新成功']);
			}else{
				$this->show(['code'=>0,'msg'=>'无数据更新']);
			}
		}

		$data['wxapp']=$this->db->get('wxapp')->row_array();
		$this->load->view('wxapp/index',$data);
	}



	public function policy(){
         $where['id']=10;
		if($this->post()){
			$post=$this->input->post();
			$res=$this->db->where($where)->update('article',$post);
			if ($res){
				$this->show(['code'=>1,'msg'=>'更新成功']);
			}else{
				$this->show(['code'=>0,'msg'=>'无数据更新']);
			}
		}
         
		$data['wxapp']=$this->db->where($where)->get('article')->row_array();
		$this->load->view('wxapp/policy',$data);
	}
	
	
		public function sales(){
            $where['id']=20;
		if($this->post()){
			$post=$this->input->post();
			$res=$this->db->where($where)->update('article',$post);
			if ($res){
				$this->show(['code'=>1,'msg'=>'更新成功']);
			}else{
				$this->show(['code'=>0,'msg'=>'无数据更新']);
			}
		}

		$data['wxapp']=$this->db->where($where)->get('article')->row_array();
		$this->load->view('wxapp/sales',$data);
	}
	
	
		public function returns(){
        $where['id']=30;
		if($this->post()){
			$post=$this->input->post();
			$res=$this->db->where($where)->update('article',$post);
			if ($res){
				$this->show(['code'=>1,'msg'=>'更新成功']);
			}else{
				$this->show(['code'=>0,'msg'=>'无数据更新']);
			}
		}

		$data['wxapp']=$this->db->where($where)->get('article')->row_array();
		$this->load->view('wxapp/returns',$data);
	}


}
